<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>学生选课系统 - 成绩查询</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
  <link rel="stylesheet" href="../css/gradesselect.css">
  <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
</head>
<body class="bg-gray-50 font-sans">
  <!-- 顶部导航栏 -->
  <header class="bg-white shadow-md fixed w-full z-50 transition-all duration-300" id="navbar">
    <div class="container mx-auto px-4 py-3 flex items-center justify-between">
      <div class="flex items-center space-x-2">
        <i class="fa-solid fa-graduation-cap text-blue-600 text-2xl"></i>
        <h1 class="text-xl font-bold text-gray-800">学生选课系统</h1>
      </div>
      
      <nav class="hidden md:flex items-center space-x-6">
        <a href="../html/home.html" class="text-gray-600 font-medium hover:text-blue-800 transition-colors">首页</a>
        <a href="../html/selectcoursecenter.html" class="text-gray-600 font-medium hover:text-blue-800 transition-colors">选课</a>
        <a href="../html/coursetable.html" class="text-gray-600 font-medium hover:text-blue-800 transition-colors">课程表</a>
        <a href="../html/gradesselect.html" class="text-blue-600 font-medium bg-blue-50 px-3 py-1 rounded-lg">成绩查询</a>
      </nav>
      
      <div class="flex items-center space-x-4">
        <div class="relative">
          <button class="flex items-center space-x-2 focus:outline-none" id="userMenuBtn">
            <img src="../course/images/user.jpg" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-blue-500">
            <span class="hidden md:inline-block text-gray-700 font-medium">张三</span>
            <i class="fa-solid fa-angle-down text-gray-500"></i>
          </button>
          
          <!-- 用户下拉菜单 -->
          <div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 hidden z-50" id="userMenu">
            <a href="../html/personalcenter.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
              <i class="fa-solid fa-user mr-2"></i>个人中心
            </a>
            <a href="../html/accountsetting.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
              <i class="fa-solid fa-cog mr-2"></i>账号设置
            </a>
            <div class="border-t border-gray-100 my-1"></div>
            <a href="../html/login.html" class="block px-4 py-2 text-sm text-red-600 hover:bg-gray-100">
              <i class="fa-solid fa-sign-out-alt mr-2"></i>退出登录
            </a>
          </div>
        </div>
        
        <button class="md:hidden focus:outline-none" id="mobileMenuBtn">
          <i class="fa-solid fa-bars text-gray-700 text-xl"></i>
        </button>
      </div>
    </div>
    
    <!-- 移动端菜单 -->
    <div class="md:hidden bg-white border-t border-gray-100 hidden" id="mobileMenu">
      <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
        <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-600 hover:text-blue-600 hover:bg-blue-50">首页</a>
        <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-600 hover:text-blue-600 hover:bg-blue-50">选课</a>
        <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-600 hover:text-blue-600 hover:bg-blue-50">课程表</a>
        <a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-blue-600 bg-blue-50">成绩查询</a>
      </div>
    </div>
  </header>

  <!-- 主内容区 -->
  <main class="container mx-auto pt-24 pb-12 px-4 md:px-6">
    <div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
      <!-- 侧边栏 -->
      <aside class="lg:col-span-1">
        <div class="bg-white rounded-xl shadow-md overflow-hidden sticky top-24">
          <div class="bg-gradient-to-r from-blue-500 to-indigo-600 p-4">
            <div class="flex items-center space-x-4">
              <img src="../images/courseimages/user.jpg" alt="用户头像" class="w-16 h-16 rounded-full object-cover border-4 border-white shadow-lg">
              <div>
                <h2 class="text-white font-bold text-xl">张三</h2>
                <p class="text-blue-100 text-sm">计算机科学与技术学院</p>
                <p class="text-blue-100 text-sm">学号: 20230001</p>
              </div>
            </div>
          </div>
          
          <nav class="p-4">
            <ul class="space-y-1">
              <li>
                <a href="../html/gradesselect.html" class="flex items-center p-3 text-blue-600 bg-blue-50 rounded-lg font-medium">
                  <i class="fa-solid fa-graduation-cap w-6"></i>
                  <span>成绩查询</span>
                </a>
              </li>
              <li>
                <a href="../html/selectcoursecenter.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-book w-6"></i>
                  <span>选课中心</span>
                </a>
              </li>
              <li>
                <a href="../html/coursetable.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-calendar-alt w-6"></i>
                  <span>课程表</span>
                </a>
              </li>
              <li>
                <a href="../html/mycollect.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-heart w-6"></i>
                  <span>我的收藏</span>
                </a>
              </li>
              <li>
                <a href="../html/courseevaluate.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-star w-6"></i>
                  <span>课程评价</span>
                </a>
              </li>
              <li>
                <a href="../html/accountsetting.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-cog w-6"></i>
                  <span>账号设置</span>
                </a>
              </li>
            </ul>
          </nav>
          
          <!-- 成绩统计 -->
          <div class="p-4 border-t border-gray-200">
            <h3 class="text-lg font-semibold text-gray-900 mb-3">成绩统计</h3>
            <div class="space-y-3">
              <div class="flex justify-between items-center">
                <span class="text-gray-600">平均绩点</span>
                <span class="font-medium text-lg">3.82</span>
              </div>
              <div class="flex justify-between items-center">
                <span class="text-gray-600">已修课程</span>
                <span class="font-medium">24门</span>
              </div>
              <div class="flex justify-between items-center">
                <span class="text-gray-600">已获学分</span>
                <span class="font-medium">85.0</span>
              </div>
              <div class="flex justify-between items-center">
                <span class="text-gray-600">排名</span>
                <span class="font-medium">前10%</span>
              </div>
            </div>
          </div>
        </div>
      </aside>
      
      <!-- 主内容 -->
      <div class="lg:col-span-3 space-y-6">
        <!-- 学期选择 -->
        <div class="bg-white rounded-xl shadow-md p-4">
          <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
            <div class="flex items-center space-x-2 mb-3 sm:mb-0">
              <label for="semesterSelect" class="text-gray-700 font-medium">选择学期:</label>
              <select id="semesterSelect" class="px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                <option value="2023-2024-1">2023-2024学年 第一学期</option>
                <option value="2022-2023-2">2022-2023学年 第二学期</option>
                <option value="2022-2023-1">2022-2023学年 第一学期</option>
                <option value="2021-2022-2">2021-2022学年 第二学期</option>
                <option value="2021-2022-1">2021-2022学年 第一学期</option>
              </select>
            </div>
            
            <div class="flex items-center space-x-2">
              <button class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition-colors flex items-center">
                <i class="fa-solid fa-download mr-1"></i> 导出成绩单
              </button>
              <button class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition-colors flex items-center">
                <i class="fa-solid fa-print mr-1"></i> 打印
              </button>
            </div>
          </div>
        </div>
        
        <!-- 成绩总览 -->
        <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
          <div class="bg-white rounded-xl shadow-md p-5">
            <div class="flex items-center justify-between">
              <div>
                <p class="text-gray-500 text-sm">平均绩点</p>
                <h3 class="text-3xl font-bold text-gray-900 mt-1">3.82</h3>
                <p class="text-green-500 text-sm mt-1 flex items-center">
                  <i class="fa-solid fa-arrow-up mr-1"></i> 较上学期提高0.12
                </p>
              </div>
              <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center">
                <i class="fa-solid fa-graduation-cap text-blue-600 text-xl"></i>
              </div>
            </div>
          </div>
          
          <div class="bg-white rounded-xl shadow-md p-5">
            <div class="flex items-center justify-between">
              <div>
                <p class="text-gray-500 text-sm">课程数量</p>
                <h3 class="text-3xl font-bold text-gray-900 mt-1">8门</h3>
                <p class="text-green-500 text-sm mt-1 flex items-center">
                  <i class="fa-solid fa-arrow-up mr-1"></i> 通过8门
                </p>
              </div>
              <div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center">
                <i class="fa-solid fa-book text-green-600 text-xl"></i>
              </div>
            </div>
          </div>
          
          <div class="bg-white rounded-xl shadow-md p-5">
            <div class="flex items-center justify-between">
              <div>
                <p class="text-gray-500 text-sm">获得学分</p>
                <h3 class="text-3xl font-bold text-gray-900 mt-1">28.0</h3>
                <p class="text-green-500 text-sm mt-1 flex items-center">
                  <i class="fa-solid fa-check mr-1"></i> 全部通过
                </p>
              </div>
              <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center">
                <i class="fa-solid fa-credit-card text-purple-600 text-xl"></i>
              </div>
            </div>
          </div>
        </div>
        
        <!-- 成绩图表 -->
        <div class="bg-white rounded-xl shadow-md p-6">
          <h3 class="text-lg font-semibold text-gray-900 mb-4">成绩分布</h3>
          <div class="h-64">
            <canvas id="gradeDistributionChart"></canvas>
          </div>
        </div>
        
        <!-- 成绩表格 -->
        <div class="bg-white rounded-xl shadow-md overflow-hidden">
          <div class="p-6">
            <h3 class="text-lg font-semibold text-gray-900 mb-4">成绩明细</h3>
            
            <div class="overflow-x-auto">
              <table class="min-w-full divide-y divide-gray-200">
                <thead class="bg-gray-50">
                  <tr>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">课程代码</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">课程名称</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">课程类型</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">学分</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">成绩</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">绩点</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">任课教师</th>
                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
                  </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200">
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">CS101</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">数据结构</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">必修课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">4.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">92</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">4.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">李四</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="CS101">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">CS103</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">操作系统</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-purple-100 text-purple-800">专业选修课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">4.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">85</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.5</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">赵六</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="CS103">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">MA101</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">高等数学</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">必修课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">5.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">88</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.7</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">孙九</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="MA101">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">EN101</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">大学英语</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">必修课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">90</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.8</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">周十</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="EN101">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">PH101</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">大学物理</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">必修课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">82</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.2</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">吴七</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="PH101">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">CS105</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">计算机网络</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-purple-100 text-purple-800">专业选修课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">94</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">4.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">郑八</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="CS105">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">PE101</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">体育</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">公共课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">1.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">86</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.6</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">王二</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="PE101">查看详情</button>
                    </td>
                  </tr>
                  <tr class="hover:bg-gray-50 transition-colors">
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">EL101</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">工程伦理</td>
                    <td class="px-6 py-4 whitespace-nowrap">
                      <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">通识课</span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">2.0</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">89</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">3.7</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">刘一</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-blue-500 hover:text-blue-700">
                      <button class="view-grade-details" data-course-id="EL101">查看详情</button>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            
            <!-- 分页 -->
            <div class="flex justify-between items-center mt-6">
              <div class="text-sm text-gray-500">
                显示 1-8 条，共 8 条
              </div>
              
              <div class="flex space-x-1">
                <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-500 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
                  <i class="fa-solid fa-angle-left"></i>
                </button>
                <button class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-600 text-white">1</button>
                <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed">
                  <i class="fa-solid fa-angle-right"></i>
                </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>

  <!-- 页脚 -->
  <footer class="bg-gray-800 text-white py-12">
    <div class="container mx-auto px-4 md:px-6">
      <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
        <div>
          <h3 class="text-lg font-bold mb-4">学生选课系统</h3>
          <p class="text-gray-400 text-sm">为学生提供便捷的选课服务和个人信息管理</p>
        </div>
        
        <div>
          <h3 class="text-lg font-bold mb-4">快速链接</h3>
          <ul class="space-y-2 text-sm">
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">选课中心</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">课程表</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">成绩查询</a></li>
          </ul>
        </div>
        
        <div>
          <h3 class="text-lg font-bold mb-4">帮助支持</h3>
          <ul class="space-y-2 text-sm">
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用指南</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">意见反馈</a></li>
          </ul>
        </div>
        
        <div>
          <h3 class="text-lg font-bold mb-4">联系我们</h3>
          <ul class="space-y-2 text-sm">
            <li class="flex items-center text-gray-400">
              <i class="fa-solid fa-envelope mr-2"></i>
              <span>support@example.com</span>
            </li>
            <li class="flex items-center text-gray-400">
              <i class="fa-solid fa-phone mr-2"></i>
              <span>010-12345678</span>
            </li>
            <li class="flex items-center text-gray-400">
              <i class="fa-solid fa-map-marker-alt mr-2"></i>
              <span>北京市海淀区中关村大街</span>
            </li>
          </ul>
        </div>
      </div>
      
      <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400 text-sm">
        <p>© 2023 学生选课系统 版权所有</p>
      </div>
    </div>
  </footer>

  <!-- 成绩详情模态框 -->
  <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="gradeDetailsModal">
    <div class="bg-white rounded-xl shadow-xl max-w-lg w-full max-h-[90vh] overflow-y-auto transform transition-all">
      <div class="p-6">
        <div class="flex justify-between items-center mb-4">
          <h3 class="text-xl font-bold text-gray-900" id="modalCourseName">数据结构 成绩详情</h3>
          <button class="text-gray-400 hover:text-gray-500 focus:outline-none" id="closeGradeDetailsModal">
            <i class="fa-solid fa-times"></i>
          </button>
        </div>
        
        <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
          <div>
            <p class="text-sm text-gray-500">课程代码</p>
            <p class="text-lg font-medium text-gray-900" id="modalCourseCode">CS101</p>
          </div>
          <div>
            <p class="text-sm text-gray-500">学分</p>
            <p class="text-lg font-medium text-gray-900" id="modalCourseCredits">4.0</p>
          </div>
          <div>
            <p class="text-sm text-gray-500">任课教师</p>
            <p class="text-lg font-medium text-gray-900" id="modalCourseTeacher">李四</p>
          </div>
          <div>
            <p class="text-sm text-gray-500">最终成绩</p>
            <p class="text-lg font-bold text-green-600" id="modalFinalGrade">92</p>
          </div>
        </div>
        
        <h4 class="font-medium text-gray-900 mb-3">成绩组成</h4>
        <div class="space-y-3 mb-6">
          <div>
            <div class="flex justify-between text-sm mb-1">
              <span class="text-gray-600">平时成绩 (30%)</span>
              <span class="font-medium">90</span>
            </div>
            <div class="w-full bg-gray-200 rounded-full h-2">
              <div class="bg-blue-600 h-2 rounded-full" style="width: 90%"></div>
            </div>
          </div>
          <div>
            <div class="flex justify-between text-sm mb-1">
              <span class="text-gray-600">实验成绩 (20%)</span>
              <span class="font-medium">95</span>
            </div>
            <div class="w-full bg-gray-200 rounded-full h-2">
              <div class="bg-blue-600 h-2 rounded-full" style="width: 95%"></div>
            </div>
          </div>
          <div>
            <div class="flex justify-between text-sm mb-1">
              <span class="text-gray-600">期中考试 (20%)</span>
              <span class="font-medium">88</span>
            </div>
            <div class="w-full bg-gray-200 rounded-full h-2">
              <div class="bg-blue-600 h-2 rounded-full" style="width: 88%"></div>
            </div>
          </div>
          <div>
            <div class="flex justify-between text-sm mb-1">
              <span class="text-gray-600">期末考试 (30%)</span>
              <span class="font-medium">92</span>
            </div>
            <div class="w-full bg-gray-200 rounded-full h-2">
              <div class="bg-blue-600 h-2 rounded-full" style="width: 92%"></div>
            </div>
          </div>
        </div>
        
        <h4 class="font-medium text-gray-900 mb-3">成绩分析</h4>
        <div class="bg-gray-50 p-4 rounded-lg mb-6">
          <p class="text-gray-700">
            该课程班级平均分为82分，最高分98分，最低分62分。你的成绩高于班级平均分10分，处于前10%的水平。
            平时成绩和实验成绩表现优秀，期末考试成绩也很稳定，继续保持！
          </p>
        </div>
        
        <div class="flex justify-end">
          <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors" id="closeGradeDetailsBtn">
            关闭
          </button>
        </div>
      </div>
    </div>
  </div>

  <script src="grades.js"></script>
</body>
</html>
    